<template>
	<div class="mainDiv" style="padding: 20px; box-sizing: border-box;">
		<el-row class="p10">
			<el-form :model="orderinfo" label-width="70px">
				<el-form-item label="产品列表">
					<el-table :data="orderlist" :stripe="true" height="500" show-summary>
						<el-table-column prop="id" label="ID" width="80"></el-table-column>
						<el-table-column prop="goodsname" label="商品名称"></el-table-column>

						<el-table-column prop="num" label="数量" width="100">
						</el-table-column>
					</el-table>
				</el-form-item>
				<el-form-item label="审核描述">
					<el-input type="textarea" v-model="orderinfo.remarks" placeholder="请输入审核描述信息" disabled></el-input>
				</el-form-item>

				<el-form-item>
					<el-button type="primary" icon="upload2" @click="onSubmit" v-show="orderinfo.status == 0" v-qx="permission.check">审核提交</el-button>
					<el-button type="danger" icon="close" @click="closewin">取消关闭</el-button>
				</el-form-item>

			</el-form>
		</el-row>
	</div>
</template>
<!-- Placed js at the end of the document so the pages load faster -->
<script>
import C from '#/src/common/common.js'
export default {
    name: 'userselectzhiwei',
    data () {
        return {
            request: {},
            orderinfo: {},
            orderlist: [],
            stut: '',
            permission: {
                check: 'orstock_check'
            }
        }
    },
    async mounted () {
        let request = C.getDatas()
        if (request) {
            this.request = request
            this.stut = request.st
        }
        let that = this
        let data = await C.ajax('/organization/stock/orderinfo', { id: this.request.id }, 'post')
        if (data) {
            that.orderinfo = data.orderinfo
            that.orderlist = data.orderlist
        }
    },
    computed: {
        typename: function () {
            return this.orderinfo.ordertype == 6 ? '入库' : '出库'
        }
    },
    methods: {
        onSubmit: async function () {
            let data = await C.ajax('/organization/stock/reviewstockorder', { id: this.request.id }, 'post')
            if (data) C.closeBrowserWindow(data)
        },
        closewin: function () {
            C.closewin()
        }
    }
}
</script>